package com.nidu.demo.notice.dto;

import com.nidu.demo.base.BaseCmd;
import com.nidu.demo.common.enums.StatusEnum;
import com.nidu.demo.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 通知公告更新命令
 *
 * @author auto
 */
@Data
@Schema(description = "通知公告更新命令")
@EqualsAndHashCode(callSuper = true)
public class NoticeUpdateCmd extends BaseCmd {

    @NotNull(message = "主键ID不能为空")
    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long id;

    @NotBlank(message = "公告标题不能为空")
    @Size(max = 50, message = "公告标题长度不能超过50个字符")
    @Schema(description = "公告标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "系统维护公告")
    private String title;

    @NotBlank(message = "公告内容不能为空")
    @Schema(description = "公告内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "系统将于今晚进行维护")
    private String content;

    @NotNull(message = "公告类型不能为空")
    @Schema(description = "公告类型（1通知 2公告）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer type;

    @NotNull(message = "公告状态不能为空")
    @InEnum(StatusEnum.class)
    @Schema(description = "公告状态（0正常 1关闭）", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
    private Integer status;

}
